#继承练习
class User():
	
	'''人物类'''
		
	def __init__(self,first_name,last_name):
		self.first_name = first_name
		self.last_name = last_name
		self.login_attempts = 0
		
	def describe_user(self):
		long_name=self.first_name+self.last_name
		print('名字是：'+long_name)
	
	def greet_user(self):
		print(self.first_name+self.last_name+'你想吃啥？')
		
	def incrment_login_attempts(self):
		self.login_attempts += 1
	
	def rest_login_attempts(self):
		self.login_attempts = 0
		
class Privileges():
	
	'''权限类'''
	
	def __init__(self):
		self.privileges = ['can add post',
			'can delete post',
			'can ban user']
		
	def show_privileges(self):
		for privilege in self.privileges:
			print('-'+privilege)

class Admin(User):
	
	'''管理员类 继承人物类'''
	
	def __init__(self,first_name,last_name):
		super().__init__(first_name,last_name)
		self.privileges = Privileges()
	
	

admin = Admin('小','豆子')
# ~ admin.privileges = ['can add post','can delete post','can ban user']
admin.describe_user()
admin.privileges.show_privileges()
